home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / grafica / pcad20a / help / def2buttons.doc < prev    next >
Text File  |  1996-11-17  |  7KB  |  189 lines

  1.  
  2.  
  3. ----------------------------------------------------------------------------------
  4. Main
  5. ----------------------------------------------------------------------------------
  6.  
  7.                             
  8.                               def2buttons
  9.  
  10.                  Copyright © 1994-96 Christian Paulsen
  11.  
  12.  
  13.                 def2buttons is part of the PCAD package
  14.                     PCAD is a shareware product!
  15.  
  16.  
  17.  
  18.  
  19. Contents
  20.  
  21.    'About 'def2buttons''
  22.    'How to 'compile' my own Tools-window'
  23.    'The .def description files'
  24.  
  25.  
  26. ----------------------------------------------------------------------------------
  27. aboutd2b
  28. ----------------------------------------------------------------------------------
  29.  
  30. What is 'def2buttons'?
  31.  
  32.  
  33. The def2buttons program may be used to create your own PCAD 'Tools'-window.
  34. def2buttons was a quick hack, rather than a comfortable interactive
  35. GUI-builder.
  36.  
  37. PCAD uses the "pcad.icons" file, usually located in the "PCAD:" directory.
  38. 'see 'Runtime Environment' for more details'
  39. This file is a binary description of all buttons in the Tools-window.
  40. As "pcad.icons" is a static description, the Tools-window will be static for
  41. one PCAD session, i.e. no buttons can be added, removed or changed while
  42. running PCAD.
  43.  
  44. The "pcad.icons" file was created by using the def2buttons program. Each
  45. button is described by one .def file. def2buttons reads all the .def-files
  46. and creates a compact binary file, that is equivalent to "pcad.icons".
  47.  
  48. There are two kinds of buttons:
  49.  
  50.  
  51. Std. action buttons
  52.  
  53. A std. action button is activated by clicking the icon (=button/gadget) with
  54. the left mousebutton and releasing it, while the mousepointer is still inside
  55. the icon (like every std. Amiga gadget). Then a single action is initiated.
  56. This action is a PCAD commandstring, which is sent to the PCAD command
  57. interpreter. As the commandstring is specified by each .def file, you can
  58. create your own button-menu, using any PCAD-commands, -scripts and/or Rexx
  59. macros.
  60. 'e.g. the 'Zoom Out' button' described by 'zoomout.def'
  61.  
  62.  
  63. Toggleselect buttons
  64.  
  65. These buttons behave like any std. Amiga toggleselect button. Activating the
  66. button will change its state from selected to unselected and vice versa. The
  67. .def file contents two commandstrings. One is sent to the command interpreter
  68. when the button switches to selected, the otherone when switching to
  69. unselected.
  70. 'e.g. the 'Grid On/Off' button' described by 'grid.def'
  71.  
  72.  
  73.  
  74.  
  75. ----------------------------------------------------------------------------------
  76. compiletw
  77. ----------------------------------------------------------------------------------
  78.  
  79. How to "compile" my own Tools-window
  80.  
  81. The directory PCAD:icons holds all .def and .pic files that you need to compile
  82. the std. 'Tools'-window. There are two kinds of files:
  83.  
  84.  
  85. .def files
  86.  
  87. Each .def file defines one button (gadget,icon). It also contents the filename
  88. of the next button-description. By this, you get something like a linked list
  89. of files. All .def files together describe the Tools-window.
  90.  
  91.  
  92. .pic files
  93.  
  94. The design (image) of each button is described by an IFF-ILBM file, that should
  95. be 26x22 (width x height) pixels big. The extension .pic is optional; you may
  96. use any names. The IFF filename is specified by the .def entry IMAGE=....
  97.  
  98.  
  99. PCAD:def2buttons
  100.  
  101. The "compiler" needs one argument:
  102.    The filename of the 1st (top-left) button.
  103.  
  104. It reads all following (NEXT=...) .def files and its .pic files, creates the
  105. buttons and saves a binary image to 'test.picon'. This binary image uses the
  106. same format as 'pcad.icons'. The 'test.picon' result may be used as
  107. 'pcad.icons' file. Don't forget to make a backup-copy of the original
  108. 'pcad.icons' file!
  109.  
  110. If you wan't to "recompile" the std. Tools-window you show follow these steps:
  111.    - you are using an Amiga shell
  112.    - enter the directory PCAD:icons
  113.       >cd PCAD:icons
  114.  
  115.    - call the 'def2buttons' "compiler"
  116.       >def2buttons zoomout.def
  117.    
  118.    - a window will be opened (your workbench should be big enough!)
  119.      and the buttons are created.
  120.          (This takes about 2s on my A4000/40/25MHz, reading the
  121.          files from HD; i.e. the buttons won't pop up immediately.
  122.          This may take some time on slow Amiga's. Watch your HD-LED
  123.          [or Floppy-LED] to check if the program still works.)
  124.      You may click the buttons to test them. The relating
  125.      PCAD-command-sequence is written to the console.
  126.  
  127.    - close the window (by using the windows std. close-gadget)
  128.  
  129.    - if everything went well, the file 'test.picon' was created
  130.  
  131.    - backup your original 'pcad.icons' file
  132.       e.g.
  133.       >copy PCAD:pcad.icons PCAD:pcad.icons.bak
  134.  
  135.    - copy the 'test.picon' to 'PCAD:pcad.icons'
  136.       >copy test.picon PCAD:pcad.icons
  137.  
  138.    - run PCAD to check the result
  139.  
  140.  
  141. ----------------------------------------------------------------------------------
  142. defiles
  143. ----------------------------------------------------------------------------------
  144.  
  145. The .def button description
  146.  
  147. .def files are ASCII files that describe the PCAD 'Tools'-window buttons.
  148. The 1st line must always be 'FILETYPE=ICON', the second line defines an unique
  149. name of the button (e.g. 'NAME=ZOOMOUT'). Then the position is set by
  150. 'LEFTEDGE=<integer>' and 'TOPEDGE=<integer>'. If the button should be
  151. top-aligned to its (left) neighbour's top you should use the special
  152. "<integer>" 'ALIGN' (e.g. 'TOPEDGE=ALIGN'). You may use the constant 'GAP' to
  153. create the std. margin between blocks (e.g. 'TOPEDGE=GAP'). If the left-
  154. and/or top-edge are given by relative values, you have to specify this by
  155. 'XRELATIVE=TRUE' and/or 'YRELATIVE=TRUE'. These values are related to the
  156. right bottom of the previous button.
  157.  
  158. The buttons image is specified by 'IMAGE=<name>' (e.g.'IMAGE=zoomout.pic').
  159. This should be an IFF ILBM picture, 26x22 pixels big.
  160.  
  161. A button may be of the 'TOGGLESELECT=TRUE' kind, like the grid-button of the
  162. std. Tools-window. If it is a toggleselect button, there are some more
  163. options:
  164.    SELECTED=TRUE           # this sets the initial state;
  165.    SELECT=<PCAD-cmd's>     # called when the state changes to selected
  166.    DESELECT=<PCAD-cmd's>   # called when the state changes to unselected
  167.  
  168. These options are mutual exclusive with the std. 'ACTION=..' definition.
  169.    ACTION=<PCAD-cmd's>     # called when button is clicked
  170.  
  171. 'See <PCAD-cmd's> for more details.'
  172.  
  173. 'ROOT=TRUE' should be specified by the 1st (i.e. top-left) button of
  174. the Tools-window. Its used for the future, declaring hierarchical
  175. button-menu trees.
  176.  
  177. The next button, is specified by the .def file of 'NEXT=..'
  178. (e.g. 'NEXT=zoomin.def') building a linked list of button descriptions.
  179.  
  180. The '#' sign initiates a comment.
  181.  
  182. Examples:
  183.  
  184. ''Zoom Out' button' described by 'zoomout.def'
  185. ''Grid On/Off' button' described by 'grid.def'
  186.  
  187. See other std. Tools-window definitions for more details.
  188.  
  189.